home *** CD-ROM | disk | FTP | other *** search
- package Local.Game.Thing
- {
- import Local.*;
- import Local.Draw.*;
- import Local.Game.World.*;
- import Local.Game.World.Map.*;
- import Local.Game.World.Map.Cell.*;
- import Local.Math.*;
- import STC9.System.*;
- import flash.display.*;
- import flash.events.*;
- import flash.geom.*;
-
- public class CEffectExplosion extends CEffect
- {
-
- private static const mRenderedExplosions:int = 1;
-
- private static const mRSize:Number = 0;
-
- private static var mFFAlt:int = 0;
-
-
- private var mNode:CNode;
-
- private var mAffectRadius:Number;
-
- public var mFastRender:Boolean;
-
- private var mDelayCount:int;
-
- public function CEffectExplosion(param1:String, param2:CPosition, param3:Number, param4:Number = 100, param5:int = 0)
- {
- if(true)
- {
- super(param2);
- if(true)
- {
- mType = param1;
- if(true)
- {
- mDamage = param4;
- if(true)
- {
- mDelayCount = param5;
- if(true)
- {
- Process = Process_Normal;
- if(true)
- {
- IncrementBuild();
- if(true)
- {
- if(!AnimationExists("stand"))
- {
- if(true)
- {
- §§push(§§findproperty(AddAnimationAsFrames));
- §§push("stand");
- §§push(§§findproperty(CCE));
- §§push(param3);
- §§push(1 + Math.random() * mRSize);
- if(true)
- {
- §§push(§§pop() - mRSize / 2);
- }
- §§pop().AddAnimationAsFrames(§§pop(),new §§pop().CCE(§§pop() * §§pop()).RenderFrames());
- if(true)
- {
- addr75:
- if(!SoundExists("explosion_1"))
- {
- if(true)
- {
- AddSound("explosion_1",Explosion_1);
- }
- AddSound("explosion_2",Explosion_2);
- }
- addr97:
- SetAnimation("stand");
- addr100:
- mAnimationFrame = 0;
- addr103:
- var _loc6_:*;
- var _loc7_:* = (_loc6_ = §§findproperty(mFFAlt)).mFFAlt + 1;
- §§push(§§findproperty(mFastRender));
- §§push((_loc6_ = §§findproperty(mFFAlt)).mFFAlt);
- if(true)
- {
- _loc6_.mFFAlt = _loc7_;
- }
- §§pop().mFastRender = §§pop() % 2 == 0;
- if(!mFastRender)
- {
- mAngle.mDelta = new CPosition(Math.random() - 0.5,Math.random() - 0.5);
- addr144:
- SetState("DELAY");
- return;
- addr125:
- }
- §§goto(addr144);
- }
- AddSound("explosion_3",Explosion_3);
- }
- AddSound("explosion_4",Explosion_4);
- §§goto(addr97);
- }
- }
- §§goto(addr75);
- }
- §§goto(addr100);
- }
- §§goto(addr103);
- }
- §§goto(addr75);
- }
- §§goto(addr125);
- }
- }
- §§goto(addr144);
- }
-
- public function State_DELAY_Enter() : void
- {
- mInvisible = true;
- }
-
- public function State_AFFECT_Enter() : void
- {
- PlaySound("explosion_" + Math.floor(Math.random() * 4 + 1));
- }
-
- public function State_DELAY() : void
- {
- if(true)
- {
- var _loc1_:*;
- §§push((_loc1_ = §§findproperty(mDelayCount)).mDelayCount);
- if(true)
- {
- _loc1_.mDelayCount = _loc2_;
- var _loc2_:*;
- §§push(_loc2_ = §§pop() - 1);
- }
- if(§§pop() < 0)
- {
- SetState("AFFECT");
- }
- }
- }
-
- public function State_AFFECT() : void
- {
- var _loc1_:* = undefined;
- SetState("ANIMATEOUT");
- Animate1();
- GetAnimationFrame();
- mLandscape.Explosion(mPosition,mSprite.mArea.width / 100);
- for each(_loc1_ in GetThings_Radius(mSprite.mArea.width / 2))
- {
- if(true)
- {
- _loc1_.AffectByExplosion(this);
- }
- }
- }
-
- public function State_ANIMATEOUT_Enter() : void
- {
- }
-
- public function State_DELAY_Exit() : void
- {
- mInvisible = false;
- }
-
- public function State_ANIMATEOUT() : void
- {
- Animate1();
- if(mAnimationFrame >= 1)
- {
- Dispose();
- }
- }
-
- public function State_AFFECT_Exit() : void
- {
- }
-
- override public function Draw() : void
- {
- if(true)
- {
- super.Draw();
- if(true)
- {
- GetAnimationFrameQ();
- if(true)
- {
- if(!(CGlobal.mFastRender || mFastRender))
- {
- DrawSprite(GetOrientationMatrix());
- }
- §§goto(addr49);
- }
- DrawSpriteQ();
- }
- }
- addr49:
- }
-
- public function Process_Normal() : void
- {
- if(Process_State != null)
- {
- Process_State();
- }
- }
-
- public function State_ANIMATEOUT_Exit() : void
- {
- }
- }
- }
-